package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.MerchantFundFlow;
import com.rockcent.mall.lib.domain.enumclass.FundTransactionFlow;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Created by oyhk on 14-6-22.
 */
@Repository
public interface MerchantFundFlowRepository extends JpaRepository<MerchantFundFlow, Long>, JpaSpecificationExecutor, MerchantFundFlowRepositoryCustom {

    List<MerchantFundFlow> findByParentIdAndMerchantIdAndMallId(Long id, Long merchantId, Long mallId);

    List<MerchantFundFlow> findByMerchantIdAndMallId(Long merchantId, Long mallId);

    List<MerchantFundFlow> findByParentIdAndMerchantIdAndMallIdOrderByDateCreatedDesc(Long id, Long merchantId, Long mallId);

    List<MerchantFundFlow> findByParentIdAndMerchantIdAndMallIdAndMerchantOrderNumOrderByDateCreatedDesc(Long id, Long merchantId, Long mallId, String merchantOrderNum);

    List<MerchantFundFlow> findByParentIdAndMerchantIdAndMallIdAndMerchantOrderNum(Long id, Long merchantId, Long mallId, String merchantOrderNum);
}
